# useWindowSize()

The `useWindowSize()` hook provides the current window `width` and `height` dimensions.

### Import

```jsx
import { useWindowSize } from 'react-haiku';
```

### Usage

import BrowserOnly from '@docusaurus/BrowserOnly';
import { UseWindowSizeDemo } from '../../demo/UseWindowSizeDemo.jsx';

<BrowserOnly fallback={<div>Loading...</div>}>
  {() => <UseWindowSizeDemo />}
</BrowserOnly>

```jsx
import { useWindowSize } from 'react-haiku';

export const Component = () => {
  const { height, width } = useWindowSize();

  return (
    <div>
      <b>Resize Your Window!</b>

      <p>Window Height: <span>{height}</span></p>
      <p>Window Width: <span>{width}</span></p>
    </div>
  );
};
```
